package com.erp.ae.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.ae.api.domain.AeWarehouseOrderInfo;
import com.erp.ae.mapper.AeWarehouseOrderInfoMapper;
import com.erp.ae.service.IAeWarehouseOrderInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 商户订单Service业务层处理
 *
 * @author erp
 * @date 2023-03-09
 */
@RequiredArgsConstructor
@Service
public class AeWarehouseOrderInfoServiceImpl implements IAeWarehouseOrderInfoService {
    private final AeWarehouseOrderInfoMapper baseMapper;


    @Override
    public List<AeWarehouseOrderInfo> queryLogisticsOrder() {
        return baseMapper.queryLogisticsOrder();
    }

    @Override
    public Integer updateAeWarehouseOrderInfo(AeWarehouseOrderInfo orderInfo) {
        return baseMapper.updateById(orderInfo);
    }

    @Override
    public AeWarehouseOrderInfo getOnlineLogisticsLabel(Long orderId) {
        return baseMapper.selectOne(new LambdaQueryWrapper<AeWarehouseOrderInfo>().eq(AeWarehouseOrderInfo::getTradeOrderId, orderId)
                .last("limit 1"));
    }
}
